//
//  CommonMacro.h
//  AppFrame
//
//  Created by GXJ on 2017/2/24.
//  Copyright © 2017年 GXJ. All rights reserved.
//
#import "DDbaseNetWork.h"
#ifndef CommonMacro_h
#define CommonMacro_h

#define WEAKSELF __weak __typeof__(self) weakSelf = self;

/* 常用字体宏 */
#define HEITIMEDIUM @"STHeitiSC-Medium"     // 黑体－简－中等
#define HEITILIGHT  @"STHeitiSC-Light"      // 黑体－简－细体
#define XINGKAIMEDIUM   @"迷你简行楷"
#define XINGKAILIGHT    @"迷你简细行楷"

/* RGB颜色宏 */
#define RGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]      // RGB颜色值（带透明度）
#define RGB(r,g,b) RGBA(r,g,b,1.0f)     // RGB颜色值（不透明）

/* APP主题颜色 */
#define APPColor RGB(42,148,249)
#define APPbuttonDisableColor RGB(210, 235, 255)
#define BackgroundColor RGB(243,243,243)

#define TitleColor RGB(55,55,55)


/* 设备屏幕宏 */
#define KScreenFrame [[UIScreen mainScreen] bounds]  // 当前屏幕frmae
#define KScreenWidth KScreenFrame.size.width          // 当前屏幕宽度
#define KScreenHeight KScreenFrame.size.height        // 当前屏幕高度
#define H(X) ((KScreenFrame.size.height) * ((X) / 568.0))    // 适配屏幕高度（以568为基准）
#define W(X) ((KScreenFrame.size.width) * ((X) / 320.0))     // 适配屏幕宽度（以320为基准）
//#define m6PScale              KScreenWidth/1242.0
#define m6PScale              KScreenWidth/1080.0

#define m6Scale               KScreenWidth/750.0
#define m5Scale               KScreenWidth/640.0

#define SCREENWIDTH KScreenFrame.size.width          // 当前屏幕宽度
#define SCREENHEIGHT KScreenFrame.size.height


/* 设备型号 */
#define iPhone4S (SCREENHEIGHT == 480)

/* 常用路径 */
#define ROOTPATH [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]   // app根目录路径

//Masonry宏
#define MAS_SHORTHAND
#define MAS_SHORTHAND_GLOBALS
#define mWeakSelf __weak typeof(self) weakSelf = self;


//字符串国际化
#define NSLocalString(key)   NSLocalizedString(key, nil)

//服务超市 标题选中文字颜色
#define SERVER_MARKET_TITLE_SELECT_COLOR @"1492ff"



/**
 *  接口返回成功状态参数
 */
#define G_REQUEST_STATUS  0

#define G_TOKEN @"token"


/* 登录 */
#define G_IS_LOGIN  @"gIsLogin"
#define G_NULL     @""
#define G_YES      @"gYes"
#define G_NO       @"gNo"

/** 绑定新手机号 */
#define G_USER_ACCOUNT_REBIND_MOBILE               @"user/account/rebindMobile"

/** 更改密码 */
#define G_USER_ACCOUNT_MODIFY_PASSWORD             @"user/account/modifyPassword"

/** 埋点上传 */
#define G_LOG_UPLOAD_USEROPLOG                     @"log/uploadUserOpLog"


/** 屏幕宽高 */
#define G_SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define G_SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
#define APP_PARAMETER        (G_SCREEN_WIDTH / 375.0)



//#define G_HTTP_IP @"http://120.27.194.121:8002"
//#define G_HTTP_IP @"http://120.26.168.214:8002"
#define G_HTTP_IP KDDIPMANAGER(@"8002")
#define KUSERUPDATEBASEURL KDDIPMANAGER(@"8088")
#define KUSERBASEURL KDDIPMANAGER(@"8006")
//#define KLocationBaseUrl @"http://120.26.168.214:8088"

//#define KUSERBASEURL @"http://120.26.168.214:8006"

//#define KUSERUPDATEBASEURL @"http://120.26.168.214:8088"

/** 获取展台应用 */
#define G_SELECTSERVICE_POST                    @"/app_api/selectService"

/** 获取服务分类 */
#define G_SELECTCATEGORY_POST                   @"/app_api/selectCategory"

/** 获取专题列表 */
#define G_SELECTSPECIAL_POST                    @"/app_api/selectSpecial"

/** 获取服务列表应用显示接口 */
#define G_SELECTSERVICEBYCATEGORYID_POST        @"/app_api/selectServiceByExhibitionCategoryId"



#define DISPATCH_ON_MAIN_THREAD(mainQueueBlock) dispatch_async(dispatch_get_main_queue(), mainQueueBlock);

#endif
